import { rcaNumberFormat0 } from './common.js'
import { commonTableOption } from './common.js'

export const tableOption = {
  ...commonTableOption,
  selection: true,
  searchLabelWidth: 100,
  menu: true,
  editBtn: false,
  delBtn: false,
  column: [
    {
      type: 'date',
      label: '周期',
      prop: 'cleanTime',
      width: 180,
      searchSpan: 12,
      searchRange: true,
      search: true,
      valueFormat: 'yyyy-MM-dd',
      slot: true,
    },
    {
      type: 'select',
      label: '运营商',
      prop: 'operators',
      width: 140,
      props: {
        label: 'operatorsName',
        value: 'operators'
      },
      dicUrl: '/rca/swckdiffafterclear/listoperators',
      formatter: (row, value, label, column) => {
        if(value=='合计'){
          return '合计'
        }else{
          return value
        }
      },
      search: true,
      rules: [
        {
          required: false,
          message: '请选择运营商',
          trigger: 'blur'
        }
      ],
    }, {
      type: 'select',
      label: '线路',
      prop: 'lineCode',
      width: 140,
      dicQuery: { allLine: true },
      //dicUrl: '/rca/swckbankcashpaymentnote/listAllSubWayLine',
	   dicUrl: '/support/swparamline/dictsecondname',
     formatter: (row, value, label, column) => {
      if(value=='小计'){
        return '小计'
      }else{
        return value
      }
    },
      props: {
        label: 'name',
        value: 'code'
      },
      search: true,
      rules: [
        {
          required: false,
          message: '请选择线路',
          trigger: 'blur'
        }
      ],
    },
    {
      label: '单程票协议',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstReceivableOnewayReceivedClean',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentReceivableOnewayReceivedClean',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '单程票退票',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstReturnOnewayReceivedClean',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentReturnOnewayReceivedClean',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '单程票合计',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstSumOnewayReceivedClean',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentSumOnewayReceivedClean',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '计次票',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstCountingTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentCountingTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '日票',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstDailyTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentDailyTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '纪念票',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstCommemorativeTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentCommemorativeTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '二维码',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstQrCodeTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentQrCodeTicket',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '人脸',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstFaceTicketCcb',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentFaceTicketCcb',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '长安通',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstCat',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentCat',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      label: '交通一卡通',
      children: [
        {
          type: 'input',
          label: '首次清分金额',
          prop: 'firstTrafficCard',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        },
        {
          type: 'input',
          label: '最新清分金额',
          prop: 'currentTrafficCard',
          width: 140,
          precision: 7,
          formatter: (row, value, label, column) => {
            return rcaNumberFormat0(value)
          },
        }
      ]
    },
    {
      type: 'select',
      label: '调整原因',
      prop: 'adjustReason',
      width: 120,
      dicUrl: '/rca/swckdiffafterclear/listadjustreason',
      props: {
        label: 'adjustReasonName',
        value: 'adjustReason'
      },
    }, {
      type: 'select',
      label: '调整状态',
      dicData: [
        {
          label: '未调整',
          value: '0'
        }, {
          label: '已调整',
          value: '1'
        },],
      prop: 'adjustStatus',
      hide: true
    }, {
      type: 'select',
      label: '确认状态',
      dicData: [
        {
          label: '未确认',
          value: '0'
        }, {
          label: '已确认',
          value: '1'
        },],
      prop: 'confirmStatus',
      hide: true
    }, {
      type: 'input',
      label: '附件名称',
      prop: 'attachment',
      hide: true,
    },]
}

export const formOption = {
  column: [
    //{
    //   type: 'select',
    //   label: '运营商',
    //   prop: 'operators',
    //   props: {
    //     label: 'operatorsName',
    //     value: 'operators'
    //   },
    //   dicUrl: '/rca/swckdiffafterclear/listoperators',
    //   search: true,
    //   rules: [
    //     {
    //       required: false,
    //       message: '请选择运营商',
    //       trigger: 'blur'
    //     }
    //   ],
    // }, {
    //   type: 'select',
    //   label: '线路',
    //   prop: 'lineCode',
    //   dicQuery: { allLine: true },
    //   dicUrl: '/support/swparamline/dictsecondname',
    //   props: {
    //     label: 'name',
    //     value: 'code'
    //   },
    //   search: true,
    //   rules: [
    //     {
    //       required: false,
    //       message: '请选择线路',
    //       trigger: 'blur'
    //     }
    //   ],
    // }, {
    //   type: 'date',
    //   label: '清分开始时间',
    //   prop: 'beginTime',
    //   valueFormat: 'yyyy-MM-dd',
    // }, {
    //   type: 'date',
    //   label: '清分结束时间',
    //   prop: 'endTime',
    //   valueFormat: 'yyyy-MM-dd',
    // }, {
    //   type: 'date',
    //   label: '上次清分日期',
    //   prop: 'lastClearDate',
    //   valueFormat: 'yyyy-MM-dd'
    // }, {
      // type: 'date',
      // label: '本次清分日期',
      // prop: 'currClearDate',
      // valueFormat: 'yyyy-MM-dd',
      // rules: [{
      //   required: true,
      //   message: "请选择本次清分日期",
      //   trigger: "change"
      // }]
    // }, {
    //   type: 'number',
    //   label: '上次清分金额',
    //   prop: 'lastClearMoney',
    // }, {
    //   type: 'number',
    //   label: '本次清分金额',
    //   prop: 'currClearMoney',
    // }, {
    //   type: 'number',
    //   label: '合计差异金额',
    //   prop: 'diffMoney',
    // }, {
    //   type: 'select',
    //   label: '调整项目（票种）',
    //   prop: 'ticketType',
    //   search: true,
    //   dicUrl: '/rca/swckdiffafterclear/listtickettype',
    //   props: {
    //     label: 'ticketTypeName',
    //     value: 'ticketType'
    //   },
    //   rules: [{
    //     required: true,
    //     message: "请选择调整项目（票种）",
    //     trigger: "change"
    //   }]
    // },
    {
      type: 'select',
      label: '调整原因',
      prop: 'adjustReason',
      dicUrl: '/rca/swckdiffafterclear/listadjustreason',
      props: {
        label: 'adjustReasonName',
        value: 'adjustReason'
      },
      rules: [{
        required: true,
        message: "请选择调整原因",
        trigger: "change"
      }]
    // }, {
    //   type: 'select',
    //   label: '调整状态',
    //   dicData: [
    //     {
    //       label: '未调整',
    //       value: '0'
    //     }, {
    //       label: '已调整',
    //       value: '1'
    //     },],
    //   prop: 'adjustStatus'
    }, {
      label: "上传附件",
      prop: "attachment",
      type: "upload",
      display: false,
      component: "zd-upload",
      dataType: "string",
      span: 24,
    },]
}
export const updateAdjustReasonOption = {
  labelWidth: 160,
  column: [
  //  {
  //     type: 'date',
  //     label: '本次清分日期',
  //     prop: 'currClearDate',
  //     valueFormat: 'yyyy-MM-dd',
  //     span: 24,
  //     rules: [{
  //       required: true,
  //       message: "请选择本次清分日期",
  //       trigger: "change"
  //     }]
  //   }, {
  //     type: 'select',
  //     label: '调整项目（票种）',
  //     prop: 'ticketType',
  //     search: true,
  //     dicUrl: '/rca/swckdiffafterclear/listtickettype',
  //     props: {
  //       label: 'ticketTypeName',
  //       value: 'ticketType'
  //     },
  //     span: 24,
  //     rules: [{
  //       required: true,
  //       message: "请选择调整项目（票种）",
  //       trigger: "change"
  //     }]
  //   }, 
    {
      type: 'select',
      label: '调整原因',
      prop: 'adjustReason',
      dicUrl: '/rca/swckdiffafterclear/listadjustreason',
      props: {
        label: 'adjustReasonName',
        value: 'adjustReason'
      },
      span: 24,
      rules: [{
        required: true,
        message: "请选择调整原因",
        trigger: "change"
      }]
    },{
      label: "上传附件",
      prop: "attachment",
      type: "upload",
      component: "zd-upload",
      dataType: "string",
      span: 24,
      display: false,
    },]
}
